// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.inventory.types;

import java.util.ArrayList;
import zombie.inventory.InventoryItem;
import zombie.inventory.ItemType;
import zombie.scripting.objects.Item;

public final class KeyRing extends InventoryItem {
    private final ArrayList<Key> keys = new ArrayList();

    public KeyRing(String module, String name, String type, String tex) {
        super(module, name, type, tex);
        this.cat = ItemType.KeyRing;
    }

    @Override
    public int getSaveType() {
        return Item.Type.KeyRing.ordinal();
    }

    public void addKey(Key key) {
        this.keys.add(key);
    }

    public boolean containsKeyId(int keyId) {
        for (int _int = 0; _int < this.keys.size(); _int++) {
            if (((Key)this.keys.get(_int)).getKeyId() == keyId) {
                return true;
            }
        }

        return false;
    }

    @Override
    public String getCategory() {
        return this.mainCategory != null ? this.mainCategory : "Key Ring";
    }

    public ArrayList<Key> getKeys() {
        return this.keys;
    }

    public void setKeys(ArrayList<Key> _keys) {
        _keys.clear();
        this.keys.addAll(_keys);
    }
}
